package com.sfjswl.fp.core.leaf.pack;

import com.sfjswl.fp.core.context.RuleContext;
import com.sfjswl.fp.core.context.RulePack;
import com.sfjswl.fp.core.leaf.base.BaseLeafFlow;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public abstract class BaseLeafPackFlow extends BaseLeafFlow {

  @Override
  protected boolean doFlow(RuleContext ctx) {
    return doPackFlow(ctx.getPack());
  }

  /*
   * process leaf flow with pack
   */
  protected abstract boolean doPackFlow(RulePack pack);
}
